package com.lshtv.model;

// default package

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import com.lshtv.enums.WorkItemEnum;
import com.lshtv.enums.WorkTypeEnum;

/**
 * Work entity. @author MyEclipse Persistence Tools
 */

public class Work implements java.io.Serializable {

    // Fields    

    private Integer id;
    private String  title;
    private String  description;
    private String  link;
    private Integer type;
    private Date    gmtCreate;
    private String  files;
    private Integer item;
    private Integer sequence;

    public WorkItemEnum getItemType() {
        return WorkItemEnum.getByValue(item);
    }

    public WorkTypeEnum getWorkType() {
        return WorkTypeEnum.getByValue(type);
    }

    public String[] getFileList() {
        if (files == null) {
            return files.split(",");
        }
        return null;
    }

    // Constructors

    /** default constructor */
    public Work() {
    }

    /** full constructor */
    public Work(String title, String description, String link, Integer type, Timestamp gmtCreate,
                String files, Integer item, Integer sequence) {
        this.title = title;
        this.description = description;
        this.link = link;
        this.type = type;
        this.gmtCreate = gmtCreate;
        this.files = files;
        this.item = item;
        this.sequence = sequence;
    }

    // Property accessors

    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return this.title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getLink() {
        return this.link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public Integer getType() {
        return this.type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Date getGmtCreate() {
        return this.gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public String getFiles() {
        return this.files;
    }

    public void setFiles(String files) {
        this.files = files;
    }

    public Integer getItem() {
        return this.item;
    }

    public void setItem(Integer item) {
        this.item = item;
    }

    public Integer getSequence() {
        return this.sequence;
    }

    public void setSequence(Integer sequence) {
        this.sequence = sequence;
    }

}